/*  1:   */ package com.rinsi.app.tzck;
/*  2:   */ 
/*  3:   */ import com.rinsi.core.CoreCache;
/*  4:   */ import com.rinsi.core.service.CoreSimpleService;
/*  5:   */ import com.rinsi.util.AssertUtil;
/*  6:   */ import com.rinsi.util.MapUtil;
/*  7:   */ import java.util.HashMap;
/*  8:   */ import java.util.List;
/*  9:   */ import java.util.Map;
/* 10:   */ import org.mybatis.spring.SqlSessionTemplate;
/* 11:   */ import org.springframework.stereotype.Service;
/* 12:   */ 
/* 13:   */ @Service
/* 14:   */ public class TzckService
/* 15:   */   extends CoreSimpleService
/* 16:   */ {
/* 17:   */   public void afterIndex(Map<String, Object> model, Map<String, Object> rMap)
/* 18:   */   {
/* 19:21 */     Map<String, Object> params = getParams(model);
/* 20:   */     
/* 21:23 */     rMap.put("organs", CoreCache.getCacheList(MapUtil.getString(params, "UID"), "organs", "ORGAN_TYPE=9"));
/* 22:   */     
/* 23:25 */     rMap.put("jds", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(800011)));
/* 24:   */   }
/* 25:   */   
/* 26:   */   public void beforeList(Map<String, Object> model)
/* 27:   */   {
/* 28:32 */     Map<String, Object> params = getParams(model);
/* 29:   */     
/* 30:34 */     Map<String, Object> config = getConfig(model);
/* 31:   */     
/* 32:36 */     Map<String, Object> organ = CoreCache.getCacheMap(MapUtil.getString(params, "UID"), "organ");
/* 33:   */     
/* 34:38 */     Map<String, Object> paramsOrgan = new HashMap();
/* 35:   */     
/* 36:40 */     paramsOrgan.putAll(params);
/* 37:   */     
/* 38:42 */     paramsOrgan.remove("ORGAN_ID");
/* 39:   */     
/* 40:44 */     paramsOrgan.putAll(organ);
/* 41:46 */     if (MapUtil.getInteger(organ, "ORGAN_TYPE").intValue() == 9)
/* 42:   */     {
/* 43:48 */       paramsOrgan.remove("SJZT");
/* 44:   */       
/* 45:50 */       List<Map<String, Object>> datas = getSqlSessionTemplate().selectList(namespace(config) + ".list", paramsOrgan);
/* 46:52 */       if (!AssertUtil.isCollectionNotEmpty(datas)) {
/* 47:54 */         getSqlSessionTemplate().insert(namespace(config) + ".insert", paramsOrgan);
/* 48:   */       }
/* 49:   */     }
/* 50:   */   }
/* 51:   */   
/* 52:   */   public void updateTzurl(String id, String url)
/* 53:   */   {
/* 54:61 */     Map<String, Object> params = new HashMap();
/* 55:   */     
/* 56:63 */     params.put("TZXX_ID", id);
/* 57:   */     
/* 58:65 */     params.put("TZXX_URL", url);
/* 59:   */     
/* 60:67 */     getSqlSessionTemplate().update("tzck.update", params);
/* 61:   */   }
/* 62:   */ }


/* Location:           D:\Users\Desktop\shanxi\项目\sxazmis\WEB-INF\classes\
 * Qualified Name:     com.rinsi.app.tzck.TzckService
 * JD-Core Version:    0.7.0.1
 */